﻿using System.Collections.Generic;
using T.FAS.Runtime.Base.Entity;
using T.FAS.Runtime.DataAccess.Engine.ValidateChecker.Entity;

namespace T.FAS.Runtime.DataAccess.Engine
{
    public class ValidateFacadeFactory
    {
        public static Dictionary<DataType, IValidaterFactory> CacheFac = new Dictionary<DataType, IValidaterFactory>
        {
            {DataType.Binary, new BinaryValidateFactory() },
            {DataType.Boolean, new BooleanValidateFactory() },
            {DataType.Int, new IntValidateFactory() },
            {DataType.Long, new LongValidateFactory() },
            {DataType.Date, new DateValidateFactory() },
            {DataType.Time, new TimeValidateFactory() },
            {DataType.DateTime, new DateTimeValidateFactory() },
            {DataType.Decimal, new DecimalValidateFactory() },
            {DataType.Timestamp, new TimestampValidateFactory() },
            {DataType.String, new StringValidateFactory() },
        };

        public static IValidaterFactory GetFactory(DataType dataType)
        {
            return CacheFac[dataType];
        }
    }
}
